package main;

import java.util.List;

import com.google.common.collect.Lists;

public class Cleaner {
  public List<String> toWords(String source) {
    final String regex = "[^-a-zA-Z]|[ ]|( -)|(^-)";
    return filter((source.toLowerCase().replaceAll(regex, " ").split(" ")));
  }

  public List<String> filter(String[] strings) {
    final List<String> res = Lists.newArrayList();
    for (String str : strings) {
      if(str.length() > 1) {
       res.add(str); 
      }
    }
    return res;
  }
}